package com.findyou.service.impl;

import com.findyou.dao.TranslationDao;
import com.findyou.pojo.Translation;
import com.findyou.service.TranslationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Title: TranslationServiceImpl
 * @Author 贾金博
 * @Package com.findyou.service.impl
 * @Date 2025/6/8 下午6:53
 * @description: 实现类
 */
@Service
public class TranslationServiceImpl implements TranslationService {

    @Autowired
    private TranslationDao translationDao;

    /**
     * 查询该用户的全部翻译历史记录
     * @param userId
     * @return
     */

    @Override
    public List<Translation> findAllByUserId(int userId) {
        return translationDao.findAllByUserId(userId);
    }


    /**
     * 插入对应用户的翻译记录
     * @param translation
     * @return
     */
    @Override
    public int insertTranslation(Translation translation) {
        return translationDao.insertTranslation(translation);
    }

}
